<?php
/* --------------------------------------------------------------
   xtbooster.php 2010-02-22 gm
   Gambio GmbH
   http://www.gambio.de
   Copyright (c) 2010 Gambio GmbH
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------
*/
?><?php
##
## xt:booster v1.0424 for xt:Commerce & Gambio
## Copyright (c) 2008 xt:booster Limited
##
## Licensed under GNU/GPL
##
defined( '_VALID_XTC' ) or die( 'Direct Access to this location is not allowed.' );

define('MODULE_XTBOOSTER_TEXT_DESCRIPTION', 'xt:booster eBay-Connector f&uuml;r xt:Commerce');
define('MODULE_XTBOOSTER_TEXT_TITLE', 'xt:booster eBay-Connector');
define('MODULE_XTBOOSTER_STATUS_DESC','Modulstatus');
define('MODULE_XTBOOSTER_STATUS_TITLE','Status');

define('MODULE_XTBOOSTER_SHOPKEY_TITLE','ShopKey');
define('MODULE_XTBOOSTER_SHOPKEY_DESC','');
define('MODULE_XTBOOSTER_STDSITE_TITLE','Standard-Site');
define('MODULE_XTBOOSTER_STDSITE_DESC','');
define('MODULE_XTBOOSTER_STDCURRENCY_TITLE','Standard-W&auml;hrung');
define('MODULE_XTBOOSTER_STDCURRENCY_DESC','');

define('MODULE_XTBOOSTER_STDPLZ_TITLE','Standard Artikelstandort (PLZ)');
define('MODULE_XTBOOSTER_STDPLZ_DESC','');
define('MODULE_XTBOOSTER_STDSTANDORT_TITLE','Standard Artikelstandort');
define('MODULE_XTBOOSTER_STDSTANDORT_DESC','');


class xtbooster
{
	var $code, $title, $description, $enabled;

    function xtbooster() {
		$this->code = 'xtbooster';
		$this->title = MODULE_XTBOOSTER_TEXT_TITLE;
		$this->description = MODULE_XTBOOSTER_TEXT_DESCRIPTION;
		$this->sort_order = MODULE_XTBOOSTER_SORT_ORDER;
		$this->enabled = ((MODULE_XTBOOSTER_STATUS == 'True') ? true : false);
	}

	function process($file) {
	}

	function display() {
		return array('text' =>
						'<br>' . xtc_button(BUTTON_REVIEW_APPROVE) . '&nbsp;' .
						xtc_button_link(BUTTON_CANCEL, xtc_href_link(FILENAME_MODULE_EXPORT, 'set=' . $_GET['set'] . '&module=xtbooster')));
    }

    function check() {
		if(!isset($this->_check)) {
			$check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_XTBOOSTER_STATUS'");
			$this->_check = xtc_db_num_rows($check_query);
		}
		return $this->_check;
	}

	function install() {
		xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,  configuration_group_id, sort_order, set_function, date_added) values ('MODULE_XTBOOSTER_STATUS', 'True',  '6', '1', '', now())");
		xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,  configuration_group_id, sort_order, set_function, date_added) values ('MODULE_XTBOOSTER_STDSITE', 'DE',  '6', '1', '', now())");
		xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,  configuration_group_id, sort_order, set_function, date_added) values ('MODULE_XTBOOSTER_STDCURRENCY', 'EUR',  '6', '1', '', now())");
	}

	function remove() {
		xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
	}

	function keys() {
		return array('MODULE_XTBOOSTER_STATUS','MODULE_XTBOOSTER_SHOPKEY','MODULE_XTBOOSTER_STDSITE','MODULE_XTBOOSTER_STDCURRENCY', 'MODULE_XTBOOSTER_STDPLZ', 'MODULE_XTBOOSTER_STDSTANDORT');
	}
}
?>
